import type { RespSysDataType } from '@/components/app/sys/api';

export declare namespace RespDataType {
  export type AllowUserUseAdminRoleItem = RespSysDataType.AllowUserUseAdminRoleItem;

  /**
   * 用户信息
   */
  export interface UserItem {
    id: number,
    userName: string,
    mobile: string,
    userNickname: string,
    birthday: number,
    userPassword: string,
    userSalt: string,
    userStatus: number,
    userEmail: string,
    sex: number,
    avatar: string,
    deptId: number,
    remark: string,
    isAdmin: number,
    address: string,
    describe: string,
    lastLoginIp: string,
    lastLoginTime: string,
    createdAt: string,
    updatedAt: string,
    dept: RespSysDataType.DeptItem
  }

  /**
   * 用户编辑数据
   */
  export interface UserEditData {
    user: {
      id: number,
      userName: string,
      mobile: string,
      userNickname: string,
      birthday: number,
      userPassword: string,
      userSalt: string,
      userStatus: number,
      userEmail: string,
      sex: number,
      avatar: string,
      deptId: number,
      remark: string,
      isAdmin: number,
      address: string,
      describe: string,
      lastLoginIp: string,
      lastLoginTime: string,
      createdAt: string,
      updatedAt: string,
      deletedAt: string
    },
    checkedAdminRoleId: number,
    checkedRoleIds: number[],
    checkedPosts: number[]
  }
}

export declare namespace RequestDataType {
  export interface CreateUserItem {
    deptId: number,
    email: string,
    nickName: string,
    mobile: string,
    postIds: number[],
    remark: string,
    roleIds: number[],
    adminRoleId: number,
    sex: number,
    status: number,
    isAdmin: number,
    userName: string,
    password: string,
    UserSalt: string
  }

  export interface UpdateUserItem extends CreateUserItem {
    userId: number;
  }
}
